package com.ys.web.del.job;

import com.ys.utils.base.j2se.DateHandler;
import com.ys.utils.base.j2se.StringHandler;
import com.ys.utils.spring.properties.Config;
import com.ys.web.del.service.DelService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class DelWithholdingJob implements Job {
    @Autowired
    private DelService delService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        //N天前日期
        String day = DateHandler.getDate(DateHandler.getDate(StringHandler.getInt(Config.pp.get("ys.del.data.month.day.number"),-31)))+" 00:00:00";
        //提现数据
        delService.delWithholdingJob(day);
        log.info("删除提现数据------"+day);
    }
}
